package com.woniuxy.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.shop.entity.Shop;
import com.woniuxy.shop.mapper.ShopMapper;
import com.woniuxy.shop.service.ShopService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService {

    @Resource
    private ShopMapper shopMapper;


    //分页
    @Override
    public Page<Shop> findByPage(Page page) {
        final QueryWrapper<Object> queryWrapper = new QueryWrapper<>();
        Page<Shop> page1 = shopMapper.selectPage(new Page<>(1,10),null);
        return page1;
    }

    //查询详情
    @Override
    public Shop viewShop(int sid) {

        return shopMapper.viewShop(sid);
    }

    @Override
    public Shop findByAddr(String addr) {
        return shopMapper.findByAddr(addr);
    }

    @Override
    public Shop findByName(String name) {
        return shopMapper.findByName(name);
    }
}
